package com.buddy.design.pattern._08adapter.poweradapter;

public class PowerAdapter implements DC5 {

    private AC220 ac220;

    public PowerAdapter(AC220 ac220) {
        this.ac220 = ac220;
    }

    @Override
    public int outputDC5V() {
        int adapterInput = ac220.outputAC200V();
        int adapterOutput = adapterInput / 44;
        System.out.println(">>>使用PowerAdapter");
        System.out.println(">>>输入AC:" + adapterInput);
        System.out.println(">>>输出DC:" + adapterOutput);
        return adapterOutput;
    }
}
